<html>
<head><meta charset="utf-8"><title>spurious (?) compiler error const_fn_union · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html">spurious (?) compiler error const_fn_union</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="176771230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176771230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176771230">(Sep 27 2019 at 18:14)</a>:</h4>
<p>I'm getting the following error (it's like the second time it's happening) ...</p>



<a name="176771232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176771232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176771232">(Sep 27 2019 at 18:14)</a>:</h4>
<div class="codehilite"><pre><span></span>[santiago@galago rust1 (master)]$ RUST_BACKTRACE=full ./x.py build -i --stage 1 src/libstd
Updating only changed submodules
Updating submodule src/tools/cargo
Submodule path &#39;src/tools/cargo&#39;: checked out &#39;ab6fa8908c9b6c8f7e2249231c395eebfbc49891&#39;
Updating submodule src/tools/clippy
Submodule path &#39;src/tools/clippy&#39;: checked out &#39;68ff8b19bc6705724d1e77a8dc17ffb8dfbbe26b&#39;
Submodules updated in 0.32 seconds
    Finished dev [unoptimized] target(s) in 0.12s
  Downloaded compiletest_rs v0.3.23
  Downloaded 1 crate (51.5 KB) in 2.74s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)
   Compiling core v0.0.0 (/home/santiago/src/oss/rust1/src/libcore)
   Compiling std v0.0.0 (/home/santiago/src/oss/rust1/src/libstd)
error: unused attribute
  --&gt; src/libcore/slice/mod.rs:66:5
   |
66 |     #[allow_internal_unstable(const_fn_union)]
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D unused-attributes` implied by `-D warnings`

error: unused attribute
    --&gt; src/libcore/str/mod.rs:2170:5
     |
2170 |     #[allow_internal_unstable(const_fn_union)]
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

error: could not compile `core`.

To learn more, run the command again with --verbose.
command did not execute successfully: &quot;/home/santiago/src/oss/rust1/build/x86_64-unknown-linux-gnu/stage0/bin/cargo&quot; &quot;build&quot; &quot;-Zconfig-profile&quot; &quot;--target&quot; &quot;x86_64-unknown-linux-gnu&quot; &quot;-Zbinary-dep-depinfo&quot; &quot;-j&quot; &quot;8&quot; &quot;--release&quot; &quot;--features&quot; &quot;panic-unwind backtrace compiler-builtins-c&quot; &quot;--manifest-path&quot; &quot;/home/santiago/src/oss/rust1/src/libtest/Cargo.toml&quot; &quot;--message-format&quot; &quot;json-render-diagnostics&quot;
expected success, got: exit code: 101
failed to run: /home/santiago/src/oss/rust1/build/bootstrap/debug/bootstrap build -i --stage 1 src/libstd
Build completed unsuccessfully in 0:00:09
</pre></div>



<a name="176771259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176771259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176771259">(Sep 27 2019 at 18:14)</a>:</h4>
<p>last time I ended fixing it by running clean</p>



<a name="176771294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176771294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176771294">(Sep 27 2019 at 18:15)</a>:</h4>
<p>does someone have an idea why this happens so I can avoid failling into this and then needing to run clean from time to time?</p>



<a name="176875013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176875013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176875013">(Sep 29 2019 at 15:02)</a>:</h4>
<p>Just ran into this as well. <code>rm -rf build/x86_64-unknown-linux-gnu/stage0-std</code> fixed it for me</p>



<a name="176875074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176875074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176875074">(Sep 29 2019 at 15:05)</a>:</h4>
<p>Not ideal obviously but maybe a pointer in the right direction?</p>



<a name="176887822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176887822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176887822">(Sep 29 2019 at 21:03)</a>:</h4>
<p>I suspect this is an incremental</p>



<a name="176890180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176890180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176890180">(Sep 29 2019 at 22:13)</a>:</h4>
<p>er, incremental issue</p>



<a name="176890181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176890181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176890181">(Sep 29 2019 at 22:13)</a>:</h4>
<p>but not sure</p>



<a name="176926259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176926259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176926259">(Sep 30 2019 at 12:19)</a>:</h4>
<blockquote>
<p>Not ideal obviously but maybe a pointer in the right direction?</p>
</blockquote>
<p>yes, to fix it I've ran clean, was mainly wondering what was the problem about</p>



<a name="176927396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176927396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176927396">(Sep 30 2019 at 12:34)</a>:</h4>
<p>the stage0 compiler was swapped out but I guess that swapping out didn't trigger an incremental cache invalidation but instead re-used the cache</p>



<a name="176929678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176929678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176929678">(Sep 30 2019 at 13:04)</a>:</h4>
<p>hm, I think I've seen that more than once but maybe I'm wrong</p>



<a name="176929688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176929688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176929688">(Sep 30 2019 at 13:05)</a>:</h4>
<p>bit unfortunate we're not seeing incremental invalidation</p>



<a name="176945577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176945577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176945577">(Sep 30 2019 at 15:52)</a>:</h4>
<p>it's definitely incremental and the issue is happening all the time</p>



<a name="176945594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176945594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176945594">(Sep 30 2019 at 15:52)</a>:</h4>
<p>needed to stop using it</p>



<a name="176950932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176950932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176950932">(Sep 30 2019 at 16:55)</a>:</h4>
<p>maybe we can slap a <code>#[allow(unused_attributes)]</code> on there for now?</p>



<a name="176950941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176950941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176950941">(Sep 30 2019 at 16:55)</a>:</h4>
<p>but sounds like something we should definitely fix</p>



<a name="176979003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/176979003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#176979003">(Sep 30 2019 at 22:04)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span>  yeah while I hate saying we should <code>#[allow(...)]</code> I would like the pain to go away :D (also seeing this frequently-ish)</p>



<a name="177192410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/177192410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#177192410">(Oct 02 2019 at 21:05)</a>:</h4>
<p>is there an issue open about this?</p>



<a name="177192986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/spurious%20%28%3F%29%20compiler%20error%20const_fn_union/near/177192986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/spurious.20(.3F).20compiler.20error.20const_fn_union.html#177192986">(Oct 02 2019 at 21:12)</a>:</h4>
<p>didn't find anything so I've just reported it <a href="https://github.com/rust-lang/rust/issues/65023" target="_blank" title="https://github.com/rust-lang/rust/issues/65023">https://github.com/rust-lang/rust/issues/65023</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>